package com.zxl.live.tools.configs;

import android.content.Context;

import com.zxl.live.tools.configs.bean.FullScreenBean;
import com.zxl.live.tools.configs.bean.KeyboardBean;

/**
 * Created by Administrator on 2016/10/6.
 */

public class AdsConfigsHelper {

    public static final int ADS_TYPE_XM = 1;

    public static final int ADS_TYPE_WAPS = 2;

    private static FullScreenBean mFullScreenBean = new FullScreenBean();

    private static KeyboardBean mKeyboardBean = new KeyboardBean();

    /**
     * 刷新数据
     */
    public static void refreshControlInfo(Context context) {
//        context.registerReceiver(new BroadcastReceiver() {
//            @Override
//            public void onReceive(Context context, Intent intent) {
//                initConfigs();
//            }
//        }, new IntentFilter(ConfigsDataProvider.AUTHORITY));
    }

    private static void initConfigs() {
        mFullScreenBean.parse();
        mKeyboardBean.parse();
    }

    public static FullScreenBean getFullScreenBean() {
        return mFullScreenBean;
    }

    public static KeyboardBean getKeyboardBean() {
        return mKeyboardBean;
    }

    public static String getConfigParams(String key) {
//        Cursor cursor = null;
//        try {
//            cursor = ApplicationHelper.getContext().getContentResolver().query(ConfigsDataProvider.URI_CONFIG, null, key, null, null);
//            while (cursor.moveToNext()) {
//                return cursor.getString(cursor.getColumnIndex(ConfigsDataProvider.COLUMN_VALUE));
//            }
//        } catch (Exception e) {
//            e.printStackTrace();
//        } finally {
//            if (null != cursor) {
//                cursor.close();
//            }
//        }
//        return OnlineConfigAgent.getInstance().getConfigParams(ApplicationHelper.getContext(), key);
        return null;
    }
}
